<template>
  <div class="mainSelect">
    <!-- 查询功能模块 -->
    <div class="select">
      <el-form ref="form" :model="addEmployeeName" label-width="80px">
        <el-form-item label="姓名:">
          <el-input
            v-model="addEmployeeName.empName"
            style="width: 150px"
          ></el-input>
        </el-form-item>
        <el-form-item label="岗位:">
          <el-input
            v-model="addEmployeeName.empJob"
            style="width: 150px"
          ></el-input>
        </el-form-item>
        <!-- <el-form-item label="用工性质:">
          <el-input v-model="addEmployeeName.empType" style="width: 150px"></el-input>
        </el-form-item>
        <el-form-item label="入职时间:">
          <el-date-picker v-model="addEmployeeName.empHirDate" type="daterange" range-separator="至"
            :start-placeholder="startTimeInput" :end-placeholder="endTimeInput"
            style="width: 270px; margin-right: 15px">
          </el-date-picker>
        </el-form-item> -->
        <el-form-item label="户籍地:">
          <el-input
            v-model="addEmployeeName.empOrigo"
            style="width: 150px"
          ></el-input>
        </el-form-item>
        <el-form-item label="学历:">
          <el-input
            v-model="addEmployeeName.empDegree"
            style="width: 150px"
          ></el-input>
        </el-form-item>
        <div style="width:400px,height:100px">
          <el-form-item>
            <el-button type="success" @click="selectPagination">查询</el-button>
<<<<<<< HEAD
            <el-button type="success" @click="add" style="margin-right: 10px"
              >添加</el-button
            >
            <el-button type="primary" style="margin-left: 20px" @click="upload"
              >上传<i class="el-icon-upload el-icon--right"></i>
=======
            <el-button type="success" @click="add" style="margin-right: 10px">添加</el-button>
            <el-button type="primary" style="margin-left: 20px" @click="upload">上传<i
                class="el-icon-upload el-icon--right"></i>
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
            </el-button>
            <el-button
              type="primary"
              style="margin-left: 20px"
              @click="download"
              >下载<i class="el-icon-download el-icon--right"></i>
            </el-button>
            <el-button
              type="primary"
              style="margin-left: 20px"
              @click="downloadPage"
              >分页下载<i class="el-icon-download el-icon--right"></i>
            </el-button>
            <el-button type="primary" style="margin-left: 20px" v-print="'#Tab'"
              >打印<i class="el-icon-upload el-icon--right"></i>
            </el-button>
            <el-button type="primary" style="margin-left: 20px" @click="downloadPage">分页下载<i class="el-icon-download el-icon--right"></i>
            </el-button>
            <el-button type="primary" style="margin-left: 20px" v-print="'#Tab'">打印<i class="el-icon-upload el-icon--right"></i>
            </el-button>
          </el-form-item>
        </div>
      </el-form>
    </div>
    <!-- 员工表格自制 -->
    <!-- <div>
      <label>请选择表格需要展示的列：</label>
      <el-checkbox-group v-model="checkedTableColumns">
        <el-checkbox v-for="column in tableColumns" :key="column.prop" :label="column.prop">{{ column.label }}</el-checkbox>
      </el-checkbox-group>
    </div>
    <el-table :data="tableData" border style="width: 100%" :header-cell-style="{ color: 'black', fontSize: '18px' }">
        <el-table-column v-for="column in bindTableColumns" :key="column.prop" width="180" :prop="column.prop" :label="column.label">
        </el-table-column>
      <el-table-column label="操作" fixed="right" width="200">
        <template slot-scope="scope">
          <el-button size="mini" type="warning" @click="$emit('editInfo', scope.row)" style="margin: 0 20px">编辑</el-button>
          <el-button size="mini" type="danger" @click="$emit('deleteEmployee', scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table> -->
    <!-- 展示查询员工的信息 -->
<<<<<<< HEAD
    <TableTemplate
      id="Tab"
      :header="header"
      :tableData="tableData"
      :title="title"
      @editInfo="editInfo"
      @add="add"
      @deleteEmployee="deleteEmployee"
    />
=======
    <TableTemplate  id="Tab" :header="header" :tableData="tableData" :title="title" @editInfo="editInfo" @add="add"
      @deleteEmployee="deleteEmployee" />
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
    <!-- 分页功能 -->
    <Pagination
      :total="total"
      :employee="employee"
      @getCurrentPage="getCurrentPage"
      @getPageSize="getPageSize"
    />
    <!-- 点击添加按钮，弹出添加员工信息的弹窗 -->
    <el-dialog
      :title="title"
      :visible.sync="centerAddDialogVisible"
      width="50%"
      center
    >
      <el-form :label-position="labelPosition" label-width="120px">
        <el-form-item
          :label="lable + ':'"
          v-for="(lable, prop, index) in adddialog"
          :key="index"
        >
          <el-input
            v-model="addEmployeeName[prop]"
            style="width: 200px"
          ></el-input>
        </el-form-item>
        <el-form-item label="入职日期:">
          <el-col :span="11">
            <el-date-picker
              type="date"
              placeholder="选择日期"
              v-model="addEmployeeName.empHirDate"
              style="width: 100%"
            >
            </el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="转正日期:">
          <el-col :span="11">
            <el-date-picker
              type="date"
              placeholder="选择日期"
              v-model="addEmployeeName.empRegDate"
              style="width: 100%"
            >
            </el-date-picker>
          </el-col>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="centerAddDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="addEmployee">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 点击编辑按钮显示对应员工的信息 -->
    <el-dialog
      :title="title"
      :visible.sync="centerEditDialogVisible"
      width="50%"
      center
    >
      <el-form :label-position="labelPosition" label-width="120px">
        <!-- <el-form-item :label="lable + ':'" v-for="(lable, prop, index) in adddialog" :key="index">
          <el-input v-model="editEmployeeName[prop]" style="width: 200px"></el-input>
        </el-form-item> -->
        <el-form-item label="序号:">
<<<<<<< HEAD
          <el-input
            v-model="editEmployeeName.empId"
            disabled
            style="width: 200px"
          ></el-input>
        </el-form-item>
        <el-form-item label="姓名:">
          <el-input
            v-model="editEmployeeName.empName"
            disabled
            style="width: 200px"
          ></el-input>
        </el-form-item>
        <el-form-item label="岗位:">
          <el-input
            v-model="editEmployeeName.empJob"
            disabled
            style="width: 200px"
          ></el-input>
        </el-form-item>
        <el-form-item label="所在项目:">
          <el-input
            v-model="editEmployeeName.emProject"
            disabled
            style="width: 200px"
          ></el-input>
        </el-form-item>
        <el-form-item label="性别:">
          <el-input
            v-model="editEmployeeName.empSex"
            disabled
            style="width: 200px"
          ></el-input>
        </el-form-item>
        <el-form-item label="户籍地:">
          <el-input
            v-model="editEmployeeName.empOrigo"
            disabled
            style="width: 200px"
          ></el-input>
        </el-form-item>
        <el-form-item label="学历:">
          <el-input
            v-model="editEmployeeName.empDegree"
            disabled
            style="width: 200px"
          ></el-input>
        </el-form-item>
        <el-form-item label="薪资(正式):">
          <el-input
            v-model="editEmployeeName.empSal"
            disabled
            style="width: 200px"
          ></el-input>
        </el-form-item>
        <el-form-item label="用工类型:">
          <el-input
            v-model="editEmployeeName.empType"
            disabled
            style="width: 200px"
          ></el-input>
        </el-form-item>
        <el-form-item label="人员性格分析:">
          <el-input
            v-model="editEmployeeName.empPerAna"
            style="width: 200px"
          ></el-input>
        </el-form-item>
        <el-form-item label="入职日期:">
          <el-col :span="11">
            <el-date-picker
              type="date"
              placeholder="选择日期"
              disabled
              v-model="editEmployeeName.empHirDate"
              style="width: 100%"
            >
=======
          <el-input v-model="editEmployeeName.empId" disabled style="width: 200px"></el-input>
        </el-form-item>
        <el-form-item label="姓名:">
          <el-input v-model="editEmployeeName.empName" disabled style="width: 200px"></el-input>
        </el-form-item>
        <el-form-item label="岗位:">
          <el-input v-model="editEmployeeName.empJob" disabled style="width: 200px"></el-input>
        </el-form-item>
        <el-form-item label="所在项目:">
          <el-input v-model="editEmployeeName.emProject" disabled style="width: 200px"></el-input>
        </el-form-item>
        <el-form-item label="性别:">
          <el-input v-model="editEmployeeName.empSex" disabled style="width: 200px"></el-input>
        </el-form-item>
        <el-form-item label="户籍地:">
          <el-input v-model="editEmployeeName.empOrigo" disabled style="width: 200px"></el-input>
        </el-form-item>
        <el-form-item label="学历:">
          <el-input v-model="editEmployeeName.empDegree" disabled style="width: 200px"></el-input>
        </el-form-item>
        <el-form-item label="薪资(正式):">
          <el-input v-model="editEmployeeName.empSal" disabled style="width: 200px"></el-input>
        </el-form-item>
        <el-form-item label="用工类型:">
          <el-input v-model="editEmployeeName.empType" disabled style="width: 200px"></el-input>
        </el-form-item>
        <el-form-item label="人员性格分析:">
          <el-input v-model="editEmployeeName.empPerAna"  style="width: 200px"></el-input>
        </el-form-item>
        <el-form-item label="入职日期:">
          <el-col :span="11">
            <el-date-picker type="date" placeholder="选择日期" disabled v-model="editEmployeeName.empHirDate" style="width: 100%">
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
            </el-date-picker>
          </el-col>
        </el-form-item>
        <el-form-item label="转正日期:">
          <el-col :span="11">
<<<<<<< HEAD
            <el-date-picker
              type="date"
              placeholder="选择日期"
              disabled
              v-model="editEmployeeName.empRegDate"
              style="width: 100%"
            >
=======
            <el-date-picker type="date" placeholder="选择日期" disabled v-model="editEmployeeName.empRegDate" style="width: 100%">
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
            </el-date-picker>
          </el-col>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="centerEditDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="showEditInfo">确 定</el-button>
      </span>
    </el-dialog>
    <!-- 点击上传按钮显示上传的弹框 -->
    <el-dialog
      title="上传文件"
      :visible.sync="centerUploadDialogVisible"
      width="30%"
      center
    >
      <el-upload
        drag
        style="margin-left: 100px"
        class="upload-demo"
        ref="upload"
        accept=".xlsx, .xlsm, .xls"
        :auto-upload="false"
        action="#"
        :limit="1"
        :file-list="fileList"
        :on-change="handleChange"
        :on-exceed="handleExceed"
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">将文件拖到此处，或<em>点击上传</em></div>
      </el-upload>
      <span slot="footer" class="dialog-footer">
        <el-button @click="centerUploadDialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="submitUpload">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
// import data from "../json/dataTable.json";
<<<<<<< HEAD
import * as dayjs from "dayjs";
=======
import * as dayjs from 'dayjs'
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
export default {
  name: "EmployeeConfirmList",
  mounted() {
    // 页面一加载就获取所有员工的信息
    // this.tableData = this.employee.slice(0, this.pageSize);
    // 查询所有员工
    // this.selectPagination();
    this.seletAllConfirmList();
  },
  computed: {
    bindTableColumns() {
      return this.tableColumns.filter((column) => column.show);
    },
    checkedTableColumns: {
      get() {
        // 返回选中的列名
        return this.bindTableColumns.map((column) => column.prop);
      },
      set(checked) {
        // 设置表格列的显示与隐藏
        this.tableColumns.forEach((column) => {
          // 如果选中，则设置列显示
          if (checked.includes(column)) {
            column.show = true;
          } else {
            // 如果未选中，则设置列隐藏
            column.show = false;
          }
        });
      },
    },
  },
  computed: {
    bindTableColumns() {
      return this.tableColumns.filter((column) => column.show);
    },
    checkedTableColumns: {
      get() {
        // 返回选中的列名
        return this.bindTableColumns.map(column => column.prop);
      },
      set(checked) {
        // 设置表格列的显示与隐藏
        this.tableColumns.forEach(column => {
        // 如果选中，则设置列显示
          if (checked.includes(column)) {
            column.show = true;
          } else {
            // 如果未选中，则设置列隐藏
            column.show = false;
          }
        })
      }
    }
  },
  data() {
    return {
      employee: [],
      total: 0,
      tableData: [],
      pageSize: 4,
      currentPage: 1,
      //删除员工的id
      empIds: [],
      //上传文件列表
      fileList: [],
      file: {},
      //上传弹框显示
      centerUploadDialogVisible: false,
      // 筛选coloum
      tableColumns: [
        {
          prop: "empId",
          label: "序号",
<<<<<<< HEAD
          show: true,
=======
          show: true
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
        },
        {
          prop: "empStaNum",
          label: "员工编号",
<<<<<<< HEAD
          show: true,
=======
          show: true
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
        },
        {
          prop: "empName",
          label: "姓名",
<<<<<<< HEAD
          show: true,
        },

        {
          prop: "empJob",
          label: "岗位",
          show: true,
=======
          show: true
        },
        
        {
          prop: "empJob",
          label: "岗位",
          show: true
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
        },
        {
          prop: "emProject",
          label: "所在项目",
<<<<<<< HEAD
          show: true,
=======
          show: true
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
        },
        {
          prop: "empSex",
          label: "性别",
<<<<<<< HEAD
          show: true,
=======
          show: true
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
        },
        {
          prop: "empOrigo",
          label: "户籍地",
<<<<<<< HEAD
          show: true,
=======
          show: true
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
        },
        {
          prop: "empDegree",
          label: "学历",
<<<<<<< HEAD
          show: true,
=======
          show: true
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
        },
        {
          prop: "empHirDate",
          label: "入职日期",
<<<<<<< HEAD
          show: true,
=======
          show: true
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
        },
        {
          prop: "empRegDate",
          label: "转正日期",
<<<<<<< HEAD
          show: true,
=======
          show: true
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
        },
        {
          prop: "empSal",
          label: "薪资(正式)",
<<<<<<< HEAD
          show: true,
=======
          show: true
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
        },
        {
          prop: "empPerAna",
          label: "人员性格分析",
<<<<<<< HEAD
          show: true,
=======
          show: true
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
        },
        {
          prop: "empCreateUser",
          label: "备注(办理人)",
<<<<<<< HEAD
          show: true,
        },
=======
          show: true
        }
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
      ],
      header: {
        empId: "序号",
        empName: "姓名",
        empJob: "岗位",
        emProject: "所在项目",
        empSex: "性别",
        empOrigo: "户籍地",
        empDegree: "学历",
        empHirDate: "入职日期",
        empRegDate: "转正日期",
        empSal: "薪资(正式)",
        empPerAna: "人员性格分析",
        empCreateUser: "备注(办理人)",
      },
      adddialog: {
        empId: "序号",
        empName: "姓名",
        empJob: "岗位",
        emProject: "所在项目",
        empSex: "性别",
        empOrigo: "户籍地",
        empDegree: "学历",
        // empHirDate: "入职日期",
        // empRegDate: "转正日期",
        empSal: "薪资(正式)",
        empType: "用工类型",
        empPerAna: "人员性格分析",
      },
      addEmployeeName: {
        empId: "",
        empName: "",
        empJob: "",
        emProject: "",
        empSex: "",
        empOrigo: "",
        empDegree: "",
        empHirDate: "",
        empRegDate: "",
        empSal: "",
        empPerAna: "",
        empCreateUser: "",
      },
      editEmployeeName: {
        empId: "",
        empName: "",
        empJob: "",
        emProject: "",
        empSex: "",
        empOrigo: "",
        empDegree: "",
        empHirDate: "",
        empRegDate: "",
        empSal: "",
        empType: "",
        empPerAna: "",
      },
      title: "修改转正员工的信息",
      //控制添加弹窗的显示与隐藏，当点击添加按钮是值变为true
      centerAddDialogVisible: false,
      centerEditDialogVisible: false,
      labelPosition: "right",
      startTimeInput: "开始日期",
      endTimeInput: "结束日期",
      startTime: "",
      endTime: "",
    };
  },
  methods: {
    // 查询所有员工
    seletAllConfirmList() {
      this.$api.employeeConfirm.getEmployeeConfirmList().then((res) => {
        // console.log(res);
        if (res.data.code == 200) {
          this.tableData = res.data.data;
          this.total = res.data.data.length;
        }
      });
    },
    // 分页查询请求数据
    selectPagination() {
      console.log(this.addEmployeeName);
      this.$api.employeeConfirm
<<<<<<< HEAD
        .getEmployeeConfirm(
          this.currentPage,
          this.pageSize,
          this.addEmployeeName
        )
=======
        .getEmployeeConfirm(this.currentPage, this.pageSize, this.addEmployeeName)
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
        .then((res) => {
          console.log(res);
          if (res.data.code == 200) {
            let data = res.data.data;
            this.employee = data.records;
            this.tableData = data.records;
            this.total = data.total;
          }
        });
    },
    // getCurrentPage 获取分页组件中传递过来的当前页page
    getCurrentPage(currentPage, pageSize) {
      this.currentPage = currentPage;
      this.pageSize = pageSize;
      this.selectPagination();
    },
    // getPageSize   获取分页组件传递过来的每页显示多少条数据
    getPageSize(currentPage, pageSize) {
      this.currentPage = currentPage;
      this.pageSize = pageSize;
      this.selectPagination();
    },
    // 显示添加员工信息的表单
    add() {
      this.centerAddDialogVisible = true;
    },
    // 点击编辑按钮显示编辑的信息
    editInfo(data) {
      this.centerEditDialogVisible = true;
      this.editEmployeeName = data;
    },
    //删除员工，使其离职
    deleteEmployee(data) {
      // this.empIds[0] = data.empId
      // console.log(data);
      // console.log(data.empId);
      this.$confirm("此操作将永久删除该文件, 是否继续?", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning",
      })
        .then(() => {
          this.$api.employeeConfirm
            .deleteEmployeeConfirm(data.empId)
            .then((res) => {
              console.log(res);
              if (res.data.code == 200) {
                this.$message({
                  type: "success",
                  message: "删除成功!",
                });
              } else {
                this.$message({
                  type: "error",
                  message: "删除失败",
                });
              }
            });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除",
          });
        });
      // this.selectPagination();
<<<<<<< HEAD
      this.seletAllConfirmList();
=======
      this.seletAllConfirmList()
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
    },
    // 添加该名员工的信息，发生Ajax请求
    addEmployee() {
      this.centerAddDialogVisible = false;
    },
    // 编辑完员工的信息后，发生请求
    showEditInfo() {
      // .slice(0, 10)
<<<<<<< HEAD
      this.editEmployeeName.empCreateTime = dayjs(
        this.editEmployeeName.empCreateTime
      ).format("YYYY-MM-DD HH:mm:ss");
      this.editEmployeeName.empUpdateTime = dayjs(
        this.editEmployeeName.empUpdateTime
      ).format("YYYY-MM-DD HH:mm:ss");
=======
      this.editEmployeeName.empCreateTime = dayjs(this.editEmployeeName.empCreateTime).format('YYYY-MM-DD HH:mm:ss')
      this.editEmployeeName.empUpdateTime = dayjs(this.editEmployeeName.empUpdateTime).format('YYYY-MM-DD HH:mm:ss')
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
      // console.log(this.editEmployeeName.empCreateTime, this.editEmployeeName.empUpdateTime);
      this.$api.employeeConfirm
        .editEmployeeConfirm(this.editEmployeeName)
        .then((res) => {
          console.log(res);
<<<<<<< HEAD
          if (res.data.code !== 200) return this.$message.error("修改用户失败");
=======
          if (res.data.code!== 200) return this.$message.error('修改用户失败')
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
          //关闭对话框
          this.centerEditDialogVisible = false;
          //刷新数据列表
          this.seletAllConfirmList();
          //提示修改成功
          this.$message.success("修改用户成功");
        });
    },
    //文件上传函数
    //文件状态改变触发
    upload() {
      this.centerUploadDialogVisible = true;
    },
    handleChange(file) {
      //(file,fileList)参数
      this.uploading = false;
      this.file = file;
    },
    //文件超出个数限制
    handleExceed() {
      this.$message.warning("仅允许上传一个文件！");
    },
    submitUpload() {
      if (!this.file.size) {
        this.$message.warning("请选择上传的文件");
        return;
      }
      // this.uploading = true;
      let formData = new FormData();
      formData.append("file", this.file.raw);
<<<<<<< HEAD
      this.$api.employeeConfirm.uploadEmployeeConfirm(formData).then((res) => {
        console.log(res);
        if (res.status == 200) {
          if (res.data !== "success") {
            this.$message({
              type: "success",
              message: "上传文件有误，请在提示.xls中查看错误信息！",
            });
            const errorFileName = "提示.xls";
            const errorlink = document.createElement("a");
            if ("download" in errorlink) {
              errorlink.download = errorFileName;
              errorlink.style.display = "none";
              errorlink.href = window.URL.createObjectURL(res.data);
              document.body.appendChild(errorlink);
              errorlink.click();
              window.URL.revokeObjectURL(errorlink.href);
              document.body.removeChild(errorlink);
            } else {
              navigator.msSaveBlob(blob, errorFileName);
            }
          } else {
            this.$message({
              type: "success",
              message: res.data,
            });
          }
        } else {
          this.$message({
            type: "error",
            message: "上传失败,请重新上传!",
          });
        }
        // this.selectPagination();
        this.seletAllConfirmList();
      });
=======
      this.$api.employeeConfirm
        .uploadEmployeeConfirm(formData)
        .then((res) => {
          console.log(res);
          if (res.status == 200) {
            if (res.data !== 'success') {
              this.$message({
                type: "success",
                message:'上传文件有误，请在提示.xls中查看错误信息！',
              });
              const errorFileName = "提示.xls";
              const errorlink = document.createElement("a");
              if ("download" in errorlink) {
                errorlink.download = errorFileName;
                errorlink.style.display = "none";
                errorlink.href = window.URL.createObjectURL(res.data);
                document.body.appendChild(errorlink);
                errorlink.click();
                window.URL.revokeObjectURL(errorlink.href);
                document.body.removeChild(errorlink);
              } else {
                navigator.msSaveBlob(blob, errorFileName);
              }
            } else { 
              this.$message({
                type: "success",
                message: res.data,
              });
             }
          } else {
            this.$message({
              type: "error",
              message: "上传失败,请重新上传!",
            });
          }
          // this.selectPagination();
          this.seletAllConfirmList()
        });
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
      this.centerUploadDialogVisible = false;
    },
    //下载文件
    download() {
      this.$api.employeeConfirm.downEmployeeConfirmListAll().then((res) => {
        console.log(res);
        const fileName = "one.xls";
        const elink = document.createElement("a");
        if ("download" in elink) {
          elink.download = fileName;
          elink.style.display = "none";
          elink.href = window.URL.createObjectURL(res.data);
          document.body.appendChild(elink);
          elink.click();
          window.URL.revokeObjectURL(elink.href);
          document.body.removeChild(elink);
        } else {
          navigator.msSaveBlob(blob, fileName);
        }
      });
    },
    //下载分页文件
    downloadPage() {
<<<<<<< HEAD
      this.$api.employeeConfirm
        .downEmployeeConfirmList(this.currentPage, this.pageSize)
        .then((res) => {
          // console.log(res);
          const downFileName = "page.xls";
          const downlink = document.createElement("a");
          if ("download" in downlink) {
            downlink.download = downFileName;
            downlink.style.display = "none";
            downlink.href = window.URL.createObjectURL(res.data);
            document.body.appendChild(downlink);
            downlink.click();
            window.URL.revokeObjectURL(downlink.href);
            document.body.removeChild(downlink);
          } else {
            navigator.msSaveBlob(blob, downFileName);
          }
        });
=======
      this.$api.employeeConfirm.downEmployeeConfirmList(this.currentPage,this.pageSize).then((res) => {
        // console.log(res);
        const downFileName = "page.xls";
        const downlink = document.createElement("a");
        if ("download" in downlink) {
          downlink.download = downFileName;
          downlink.style.display = "none";
          downlink.href = window.URL.createObjectURL(res.data);
          document.body.appendChild(downlink);
          downlink.click();
          window.URL.revokeObjectURL(downlink.href);
          document.body.removeChild(downlink);
        } else {
          navigator.msSaveBlob(blob, downFileName);
        }
      });
>>>>>>> 1085ebeffc9de7726919cf874ca041adc7265163
    },
    // 接收子组件传递过来的数据
    updateTableData(tableData) {
      this.tableData = tableData;
    },
    selectEmployee() {},
  },
};
</script>

<style scoped lang="less">
.select {
  .el-form {
    display: flex;
    flex-wrap: wrap;

    .el-form-item {
      flex: 10%;
    }

    .el-form-item:nth-child(7) {
      margin-left: -1180px;
    }
  }
}

.el-input {
  width: 85px;
  height: 10px;
  margin-left: 10px;
  margin-right: 10px;
}

.el-dialog {
  transform: translate(-50%, 50%);

  .el-form {
    display: flex;
    flex-wrap: wrap;
    padding-right: 40px;

    .el-form-item {
      flex: 50%;
    }
  }
}
</style>
